package com.sf.protal.admin.service.impl;

import com.sf.protal.admin.dao.UmsUserMapper;
import com.sf.protal.admin.pojo.UmsAdmin;
import com.sf.protal.admin.service.UmsUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UmsUserServiceImpl implements UmsUserService{

	@Autowired
	private UmsUserMapper userMapper;

	@Override
	public UmsAdmin getAdmin(Integer id) {
		UmsAdmin ua = new UmsAdmin();
		ua.setUserId(id);
		UmsAdmin admin = userMapper.selectOne(ua);
		return admin;
	}

	@Override
	public UmsAdmin SelectUser(String username, String password) {
		UmsAdmin admin = new UmsAdmin().setUsername(username).setPassword(password);
		return userMapper.selectOne(admin);
	}

	@Override
	public UmsAdmin getUser(UmsAdmin user) {
		return userMapper.selectOne(user);
	}
}
